package org.example;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Myql {
    public static Connection gitconn() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");
        // 创建连接
        String url = "jdbc:mysql://localhost:3306/student?useSSL=false&useUnicode=true&characterEncoding=utf8";
        String username = "root";
        String password = "123456";
        Connection conn = DriverManager.getConnection(url, username, password);
        return conn;
    }
}




